import sys

# ArmSVE tests must be enabled via build flag.
if not config.mlir_run_arm_sve_tests:
    config.unsupported = True

# No JIT on win32.
if sys.platform == 'win32':
    config.unsupported = True

lli_cmd = 'lli'
if config.arm_emulator_lli_executable:
    lli_cmd = config.arm_emulator_lli_executable

config.substitutions.append(('%mlir_native_utils_lib_dir',
    config.arm_emulator_utils_lib_dir or config.mlir_lib_dir))

if config.arm_emulator_executable:
    # Run test in emulator (qemu or armie)
    emulation_cmd = config.arm_emulator_executable
    if config.arm_emulator_options:
        emulation_cmd = emulation_cmd + ' ' + config.arm_emulator_options
    emulation_cmd = emulation_cmd + ' ' + lli_cmd
    config.substitutions.append(('%lli', emulation_cmd))
else:
    config.substitutions.append(('%lli', lli_cmd))
